#ifndef BMP_H_INCLUDED
#define BMP_H_INCLUDED

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>

#define HEADER_FILE_SIZE 14
#define HEADER_BMP_SIZE 40
#define ALIGN_BYTES 2*sizeof(short int)

#pragma pack(2)
typedef struct __BMP__FILE__HEADER{
    unsigned short int Bftype;
    unsigned int BfSize;
    unsigned short int BfReser1,BfReser2;
    unsigned int BfOffSet;
}BMP_FILE_HEADER;

#pragma pack(8)
typedef struct __BMP__BITMAP__HEADER{
    unsigned int BiSize;
    unsigned int BiWidth;
    unsigned int BiHeight;
    unsigned short int BiPlanes;
    unsigned short int BiBitCount;
    unsigned int BiCompress;
    unsigned int BiSizeImag;
    unsigned int BXPPMeter;
    unsigned int BYPPMeter;
    unsigned int BiClrUsed;
    unsigned int BiClrImport;
}BMP_BITMAP_HEADER;

typedef struct __BMP{
    BMP_FILE_HEADER fileHeader;
    BMP_BITMAP_HEADER bmpHeader;
    char *image;
}BMP;

void printBMPFileHeader(BMP *bmp);
int readHeaderBMPFile(BMP *bmp,FILE *arq);
int readImageBMP(BMP *bmp,FILE *arq);

#endif
